<?php /* УТФ-8:fix */

class SPIcontroller__brands extends SPIcontroller__dummy
{
	public /* readonly */ $MEDIA_GID = 'brands';
	
	public function selectBrands()
	{
		$brandList = array();
		$qresult = SPIm::I('brands')->manage->select();
		
		if( $qresult === false )
			return false;
			
		while( $item = $qresult->fetch() )
		{
			$item['preview'] = SPIm::I('media')->get_public_sourceByIndexOld(
                $this->MEDIA_GID, $item['id'], 1,
                array( 'mode' => 'preview' )
            );
			
			$brandList[$item['id']] = $item;
        }
        $qresult->close();
		
		return $brandList;
	}
}
